package com.itheima_05;
// 方法重载
public class MethodDemo {
    public static void main(String[] ags) {
        // 调用方法
        int result = sum(1, 2);
        System.out.println(result);
        double result2 = sum(1.0, 2.0);
        System.out.println(result2);
        int result3 = sum(1, 2, 3);
        System.out.println(result3);
    }
    // 1
    public static int sum(int a, int b) {
        return a + b;
    }
    // 2
    public static double sum(double a, double b) {
        return a + b;
    }
    // 3
    public static int sum(int a, int b, int c) {
        return a + b + c;
    }
}
